﻿@using SlamDunk.CMS.BLL
@using SlamDunk.CMS.Model
@using SlamDunk.CMS.Model.DataModel
@{
    LinkBll linkBll = new LinkBll();
    List<Link> bannerList = linkBll.GetModelList(1);
}
<div class="Banner">
    <div class="bd">
        <ul>
            @foreach (Link banner in bannerList)
            {
                <li>
                    <div class="sa"><a href="@banner.Url">@banner.LinkName</a></div>
                    <a target="_blank" href="@banner.Url"><img src="@banner.ImagePath" /></a>
                </li>
            }
        </ul>
    </div>
    <div class="hd"><ul></ul></div><!--自动分页-->
    <div class="pnBtn prev">
        <span class="blackBg"></span>
        <a class="arrow" href="javascript:void(0)"></a>
    </div>
    <div class="pnBtn next">
        <span class="blackBg"></span>
        <a class="arrow" href="javascript:void(0)"></a>
    </div>
</div>
<script type="text/javascript">
    /* 把最后一个放到第一个前面，然后通过外层ul{margin-left:-990px !important; }来显示第一个 */
    jQuery(".Banner .bd li").first().before(jQuery(".Banner .bd li").last());
    /* 控制左右按钮显示 */
    jQuery(".Banner").hover(function () { jQuery(this).find(".arrow").stop(true, true).fadeIn(300) }, function () { jQuery(this).find(".arrow").fadeOut(300) });
    /* 调用SuperSlide */
    jQuery(".Banner").slide({ titCell: ".hd ul", mainCell: ".bd ul", effect: "leftLoop", autoPlay: true, vis: 3, autoPage: true, trigger: "click" });
</script> 